package com.jy.qnbbs.service.impl;


import com.jy.qnbbs.dao.BbsSortDao;
import com.jy.qnbbs.entity.BbsSort;
import com.jy.qnbbs.service.BbsSortService;
import com.jy.qnbbs.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BbsSortServiceImpl implements BbsSortService {

    @Autowired
    private BbsSortDao bbsSortDao;

    @Override
    public Result<List<BbsSort>> queryAllBbsSort() {
        Result<List<BbsSort>> result=new Result<>();
        List<BbsSort> bbsSortList=bbsSortDao.findBbsSortAll();
        if (bbsSortList.size()>0){
            result.setStatus(0);
            result.setData(bbsSortList);
        }else{
            result.setStatus(1);
            result.setMsg("没有讨论版区");
        }
        return result;
    }
}
